package com.gitee.wsl.common.ui.viewport.ext

//
//import androidx.compose.ui.geometry.Offset
//import androidx.compose.ui.geometry.Size
//import com.gitee.wsl.common.ui.viewport.manager.ViewportManager
//import com.gitee.wsl.common.ui.viewport.scale.Scale
//import com.gitee.wsl.common.ui.viewport.scene.SceneOffset
//import com.gitee.wsl.common.ui.viewport.scene.SceneUnit
//import com.gitee.wsl.common.ui.viewport.scene.sceneUnit
//import com.gitee.wsl.common.ui.viewport.scene.times
//
//
//fun Offset.toSceneOffset(viewportManager: ViewportManager): SceneOffset = toSceneOffset(
//    viewportCenter = viewportManager.cameraPosition.value,
//    viewportSize = viewportManager.size.value,
//    viewportScaleFactor = viewportManager.scaleFactor.value,
//)
//
//fun Offset.toSceneOffset(
//    viewportCenter: SceneOffset,
//    viewportSize: Size,
//    viewportScaleFactor: Scale,
//): SceneOffset = viewportCenter + SceneOffset(
//    x = (x - viewportSize.width / 2).sceneUnit,
//    y = (y - viewportSize.height / 2).sceneUnit,
//) / viewportScaleFactor
//
//operator fun Offset.div(scale: Scale) = Offset(
//    x = x / scale.horizontal,
//    y = y / scale.vertical,
//)
//
//operator fun Offset.times(scale: Scale) = Offset(
//    x = x * scale.horizontal,
//    y = y * scale.vertical,
//)
//
//operator fun Offset.times(scale: SceneUnit) = SceneOffset(
//    x = x * scale,
//    y = y * scale,
//)
